<template>
  <div>
    <Header />
    <div class="back">
      <div class="container">
        <Nested :list='nestedList' />
        <div class="default-box">
          <div class="box-title">
            <div class="vertical-line" />
            <span>全部院校</span>
          </div>
          <div class="content">
            <div class="search">
              <input type="text" placeholder="搜索院校">
              <button>搜索</button>
            </div>
            <Filter :list="provinces" :selectList="selectList" title="所属地区" />
            <Filter :list="major" :selectList="selectList" title="学校类型" />
            <Filter :list="schoolType2" :selectList="selectList" title="学校级别" />
            <Filter :list="type" :selectList="selectList" title="办学性质" />
            <Filter :list="rank" :selectList="selectList" title="大学排名" />
            <Filter :list="admissionBrochure" :selectList="selectList" title="著名院校" />
          </div>
        </div>
        <div class="content">
          <div class="title">共找到<span class="color-primary">2898</span>所学校</div>
          <div class="desc">注：以下红色字体为 2021年招生章程并已经高校上级主管部门审核通过。</div>
          <Table :dataSource="dataSource" :columns="columns" :pagination="false" />
          <div>
          </div>
        </div>
      </div>
      <Footer />
    </div>
  </div>
</template>

<script lang="ts" setup>
import Header from '../../components/header/index.vue'
import Nested from '@/components/nested/index.vue'
import universityList from '@/components/universityList/index.vue'
import Footer from '@/components/footer/index.vue'
import Filter from '@/components/filter/index.vue'
import { provinces, major,schoolType2,type,rank,admissionBrochure } from '@/components/universityNavList/data'
import { ref } from 'vue'
import { NestedType } from '@/components/nested/nested';
import { Table } from 'ant-design-vue'





const nestedList = ref<NestedType[]>([{ name: '首页', path: '/' }, { name: '批次线' }])
const selectList = ref<string[]>(['全部', '山东', '北京','不限'])
const columns: any = [
  {
    title: '省份',
    dataIndex: 'province',
    key: 'province',
    align: 'center',
  },
  {
    title: '年份',
    dataIndex: 'year',
    key: 'year',
    align: 'center',
  },
  {
    title: '考生类别',
    dataIndex: 'candidateType',
    key: 'candidateType',
    align: 'center',
  },
  {
    title: '批次',
    dataIndex: 'batch',
    key: 'batch',
    align: 'center',
  },
  {
    title: '批次线',
    dataIndex: 'batchLine',
    key: 'batchLine',
    align: 'center',
  },
];




function getRandomProvince() {
  const provinces = ['北京', '上海', '广东', '江苏', '浙江', '四川', '湖北', '湖南', '河北', '河南'];
  return provinces[Math.floor(Math.random() * provinces.length)];
}

function getRandomYear() {
  return Math.floor(Math.random() * 10) + 2010;
}

function getRandomCandidateType() {
  const types = ['文科', '理科'];
  return types[Math.floor(Math.random() * types.length)];
}

function getRandomBatch() {
  const batches = ['本科一批', '本科二批', '专科批'];
  return batches[Math.floor(Math.random() * batches.length)];
}

function getRandomBatchLine() {
  return Math.floor(Math.random() * 100) + 500;
}

const data = () => {
  const arr: any = [];

  for (let i = 0; i < 10; i++) {
    arr.push({
      province: getRandomProvince(),
      year: getRandomYear(),
      candidateType: getRandomCandidateType(),
      batch: getRandomBatch(),
      batchLine: getRandomBatchLine(),
    });
  }
  return arr

}
const dataSource = data();

</script>

<style lang="less" scoped>
@import './index.less';
</style>
